/*
 * Monitor.java
 *
 * Created on 14 November 2005, 06:25
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */
package com.agentfactory.platform.monitor;

import java.util.ArrayList;
/**
 *
 * @author Administrator
 */
public abstract class Monitorable {
    private ArrayList monitors = new ArrayList();
    
    public void addMonitor(Monitor monitor) {
        monitors.add(monitor);
        initializationEvent();
    }
    
    public void removeMonitor(Monitor monitor) {
        monitors.remove(monitor);
    }
    
    public void notifyMonitors(Object event) {
        for (int i=0; i < monitors.size(); i++) {
            ((Monitor) monitors.get(i)).update(this, event);
        }
    }
    
    public abstract void initializationEvent();
    public abstract String getMonitorName();
}
